<?php

/** TBlog TBlog博客系统　BY Tmac PHP MVC framework
 *  $Author: zhangwentao $
 *  $Id: DatabaseDriver.class.php 1872 2011-04-22 01:37:56Z zhangwentao $
 */
class DatabaseDriver
{

    /**
     * 数据库实例
     *
     * @var object
     * @static
     */
    protected static $instance = array();

    /**
     * 取得缓存实例
     *
     * @return object
     * @access public
     * @static
     */
    public static function getInstance($name)
    {
        $class = 'Db' . $GLOBALS['db'][$name]['dbdriver'];
        if (!isset(self::$instance[$name])) {
            $config = $GLOBALS['db'][$name];
            self::$instance[$name] = new $class($config);
        }
        return self::$instance[$name];
    }
	
}